///|
enum DigitalMode {
  Combine(String)
  Split(Sign, String)
}

///|
const DIGITAL_STR = "0123456789"

///|
pub fn is_pure_digital_str(str : String) -> Bool {
  for index = 0; index < str.length(); index = index + 1 {
    guard DIGITAL_STR.contains_char(str.char_at(index)) else { return false }

  }
  true
}

///|
test "is_pure_digital_str" {
  assert_eq!(is_pure_digital_str("0"), true)
}

///|
pub fn is_combine_value(self : DigitalMode) -> Bool {
  match self {
    Combine(combine_str) => {
      let digital_str = if "+=".contains_char(combine_str.char_at(0)) {
        combine_str.substring(start=1)
      } else {
        combine_str
      }
      is_pure_digital_str(digital_str)
    }
    _ => false
  }
}

///|
pub fn is_split_value(self : DigitalMode) -> Bool {
  match self {
    Split(_, pure_digital_str) => is_pure_digital_str(pure_digital_str)
    _ => false
  }
}
